Skip to content

Optimize HGETDEL to pause auto shrink when deleting multiple items#3535

Merged
enjoy-binbin merged 1 commit intovalkey-io:unstablefrom
charsyam:fix/hgetdel-pause-autoshrink-from-unstable
Apr 23, 2026
Merged

Optimize HGETDEL to pause auto shrink when deleting multiple items#3535
enjoy-binbin merged 1 commit intovalkey-io:unstablefrom
charsyam:fix/hgetdel-pause-autoshrink-from-unstable

Conversation

@charsyam
Copy link
Copy Markdown
Contributor

@charsyam charsyam commented Apr 19, 2026

Match HGETDEL with the existing batch-delete pattern used by HDEL.

HDEL already pauses hashtable auto-shrink while deleting multiple fields so shrink evaluation is deferred until the batch completes. HGETDEL was missing the same optimization even though it also deletes fields in a loop.

Pause auto-shrink for hashtable-encoded hashes before the HGETDEL delete loop and resume it once afterwards. This preserves observable behavior and reduces redundant shrink work for multi-field deletes.

Same as #3144.

Match HGETDEL with the existing batch-delete pattern used by HDEL.

HDEL already pauses hashtable auto-shrink while deleting multiple
fields so shrink evaluation is deferred until the batch completes.
HGETDEL was missing the same optimization even though it also deletes
fields in a loop.

Pause auto-shrink for hashtable-encoded hashes before the HGETDEL
delete loop and resume it once afterwards. This preserves observable
behavior and reduces redundant shrink work for multi-field deletes.

Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.46%. Comparing base (4a42c95) to head (7d82364).
⚠️ Report is 11 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #3535      +/-   ##
============================================
+ Coverage     76.40%   76.46%   +0.06%     
============================================
  Files           159      159              
  Lines         79851    79853       +2     
============================================
+ Hits          61008    61062      +54     
+ Misses        18843    18791      -52     
Files with missing lines Coverage Δ
src/t_hash.c 95.40% <100.00%> (+<0.01%) ⬆️

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@enjoy-binbin enjoy-binbin changed the title hash: pause auto-shrink during HGETDEL Optimize HGETDEL to pause auto shrink when deleting multiple items Apr 23, 2026
@enjoy-binbin enjoy-binbin merged commit 9709843 into valkey-io:unstable Apr 23, 2026
59 checks passed
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Apr 23, 2026
…alkey-io#3535)

Match HGETDEL with the existing batch-delete pattern used by HDEL.

HDEL already pauses hashtable auto-shrink while deleting multiple fields
so shrink evaluation is deferred until the batch completes. HGETDEL was
missing the same optimization even though it also deletes fields in a loop.

Pause auto-shrink for hashtable-encoded hashes before the HGETDEL delete
loop and resume it once afterwards. This preserves observable behavior
and reduces redundant shrink work for multi-field deletes.

Same as valkey-io#3144.

Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants